Research
Security News
Malicious PyPI Package ‘pycord-self’ Targets Discord Developers with Token Theft and Backdoor Exploit
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
@turf/rhumb-destination
Advanced tools
@turf/rhumb-destination is a module from the Turf.js library that allows you to calculate the destination point given a starting point, distance, and bearing using rhumb lines. Rhumb lines are paths of constant bearing, which are useful for navigation and mapping applications.
Calculate Rhumb Line Destination
This feature allows you to calculate the destination point from a given starting point, distance, and bearing using rhumb lines. The code sample demonstrates how to use the `rhumbDestination` function to find a point 50 kilometers east of the starting point.
const turf = require('@turf/turf');
const start = turf.point([-75.343, 39.984]);
const distance = 50;
const bearing = 90;
const units = 'kilometers';
const destination = turf.rhumbDestination(start, distance, bearing, {units: units});
console.log(destination);
Geolib is a library for geospatial calculations. It provides functions for distance calculations, finding the center of a collection of points, and more. Unlike @turf/rhumb-destination, Geolib does not specifically focus on rhumb lines but offers a broader range of geospatial utilities.
Geodesy is a library for geodesic calculations. It includes functions for calculating distances, bearings, and destinations on the Earth's surface. While it provides more general geodesic calculations, it does not specifically focus on rhumb lines like @turf/rhumb-destination.
Spherical Geometry is a library for performing spherical geometry calculations, including distance and area calculations on the Earth's surface. It focuses on spherical rather than rhumb line calculations, making it different from @turf/rhumb-destination.
Returns the destination Point having travelled the given distance along a Rhumb line from the origin Point with the (varant) given bearing.
origin
Coord starting point
distance
number distance from the starting point
bearing
number varant bearing angle ranging from -180 to 180 degrees from north
options
Object Optional parameters (optional, default {}
)
var pt = turf.point([-75.343, 39.984], {"marker-color": "F00"});
var distance = 50;
var bearing = 90;
var options = {units: 'miles'};
var destination = turf.rhumbDestination(pt, distance, bearing, options);
//addToMap
var addToMap = [pt, destination]
destination.properties['marker-color'] = '#00F';
Returns Feature<Point> Destination point.
This module is part of the Turfjs project, an open source module collection dedicated to geographic algorithms. It is maintained in the Turfjs/turf repository, where you can create PRs and issues.
Install this single module individually:
$ npm install @turf/rhumb-destination
Or install the all-encompassing @turf/turf module that includes all modules as functions:
$ npm install @turf/turf
FAQs
turf rhumb-destination module
The npm package @turf/rhumb-destination receives a total of 643,986 weekly downloads. As such, @turf/rhumb-destination popularity was classified as popular.
We found that @turf/rhumb-destination demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.